<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>3-事件对象兼容性</title>
	</head>
	<body>
		<button class="btn">点击</button>
		<script type="text/javascript">
			/**
			 * JS
			 * JS基础...
			 * DOM 文档对象模型
			 * BOM 浏览器对象模型
			 */
			
			function randStr(){
				console.log('123');
			}
			window.randStr();
			
			//点击
			document.querySelector('.btn').onclick = function(e){
				//e是事件对象(e.pageX,e.pageY)
				console.log(e);
				//IE6-8 window.event
				e = e||window.event;
				console.log(e);
			}
		</script>
	</body>
</html>
